﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class MainGameManager : MonoBehaviour
{
    Text level;
    Text powerValue;
    Text roleName;
    Text money;
    public GameObject yindaopanel;//引导的panel

    // Start is called before the first frame update
    void Start()
    {
        level = GameObject.Find("level").GetComponent<Text>();
        powerValue = GameObject.Find("powerValue").GetComponent<Text>();
        roleName = GameObject.Find("name").GetComponent<Text>();
        money = GameObject.Find("money").GetComponent<Text>();

        level.text = "LV:" + VariableDocument.GetInstance.level;
        powerValue.text = "战斗力：" + VariableDocument.GetInstance.power;
        roleName.text = VariableDocument.GetInstance.name;
        money.text = VariableDocument.GetInstance.money.ToString();

        if(VariableDocument.GetInstance.yindaoid == 1)
        {
            yindaopanel.transform.GetChild(0).gameObject.SetActive(true);
        }
        if(VariableDocument.GetInstance.yindaoid == 5)
        {
            yindaopanel.transform.GetChild(0).gameObject.SetActive(false);
            yindaopanel.transform.GetChild(1).gameObject.SetActive(true);
        }
        if (VariableDocument.GetInstance.yindaoid == 9 || VariableDocument.GetInstance.yindaoid == 18)
        {
            yindaopanel.transform.GetChild(1).gameObject.SetActive(false);
            yindaopanel.transform.GetChild(2).gameObject.SetActive(true);
        }
        if (VariableDocument.GetInstance.yindaoid == 12)
        {
            yindaopanel.transform.GetChild(2).gameObject.SetActive(false);
            yindaopanel.transform.GetChild(3).gameObject.SetActive(true);
        }
        if (VariableDocument.GetInstance.yindaoid == 15)
        {
            yindaopanel.transform.GetChild(3).gameObject.SetActive(false);
            yindaopanel.transform.GetChild(4).gameObject.SetActive(true);
        }
        if (VariableDocument.GetInstance.yindaoid == 21)
        {
            yindaopanel.transform.GetChild(4).gameObject.SetActive(false);
            yindaopanel.transform.GetChild(5).gameObject.SetActive(true);
        }
        if (VariableDocument.GetInstance.yindaoid > 21)
        {
            yindaopanel.SetActive(false);
        }
        //Debug.Log(VariableDocument.GetInstance.yindaoid);
    }

    // Update is called once per frame
    void Update()
    {
        
    }
}
